'use strict';

const buildJS = require('./webpack');
// const jade2js = require('./jade2js');
const clean = require('./clean');
const styl2css = require('./styl2css');
const gutil = require('gulp-util');

//预编译css
clean(['public/css/*'], function() {
    styl2css([
        'app/client/css/**/*.styl',
        '!app/client/css/comms/**/*.styl',
        '!app/client/css/mixins/**/*.styl',
        '!app/client/css/partials/**/*.styl'
    ], 'public/css', function() {
        gutil.log('stylus编译完成');
    }, function(err) {
        gutil.log('我艹，stylus预编译出错！', err);
    });
});

//打包js
clean(['public/js/*'], function() {
    buildJS.production(['app/client/js/*/*.js'], 'public/js', null, function(err) {
        gutil.log('我艹，webpack打包出错！', err);
    });
});